{% load i18n static cms_tags sekizai_tags %}{% spaceless %}

{% page_url "shop-search-product" as search_product_url %}
{% if search_product_url or search_autocomplete %}

	{% addtoblock "js" %}<script src="{% static 'shop/js/utils.js' %}" type="text/javascript"></script>{% endaddtoblock %}
	{% addtoblock "js" %}<script src="{% static 'shop/js/search-form.js' %}" type="text/javascript"></script>{% endaddtoblock %}
	{% add_data "ng-requires" "django.shop.search" %}

<form shop-product-search class="{{ search_form_classes }}" role="search" method="get"{% if search_product_url %} action="{{ search_product_url }}"{% endif %}>
	{% if search_product_url %}
	<div class="input-group w-100">
	{% endif %}
		<input name="q" ng-model="searchQuery" {% if search_autocomplete %}ng-change="autocomplete()" {% endif %}type="search" class="form-control" placeholder="{% trans 'Search' %}" />
	{% if search_product_url %}
		<div class="input-group-append" ng-click="submitSearch()" uib-tooltip="{% trans "Refine your search" %}" tooltip-placement="left">
			<i class="input-group-text fa fa-search"></i>
		</div>
	</div>
	{% endif %}
</form>

{% endif %}
{% endspaceless %}
